<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>



<section class="background-page">
	<div class="row padding-top">

		<tiles:insertAttribute name="adminmenu" />

		<article class="column custom-main-column">

			<div id="top" class="row collapse">
				<div class="column large-12">

					<s:form action="sendEmail" namespace="/admin" method="post"
						cssClass="custom ng-pristine ng-valid" theme="simple"
						name="myForm">

						<div class="row">
							<div
								class="box-shadow background-white more-margin-bottom clearfix card content-padding">
								<div
									class="large-12 clearfix blue-topper heading-padding card-header">
									<h3 class="inverse no-margin-top no-margin-bottom">
										<span class="semi-bold"><em>Select User Group</em></span>
									</h3>
								</div>
								<div class="column large-4 small-margin-top">
									<p class="gray italic">Users conformed to following
										criteria will be notified by email:</p>
								</div>

								<div class="column large-8 small-margin-top small-margin-bottom">
									<div class="form-row rp_listing_details_category">
										<label for="region">Please select the region</label>
										<div class="row category-hybrid">
											<div class="column large-12 category-hybrid-root">
												<div>
													<select name="user.region" id="region"
														onChange="changeRegion()">
														<option value="0">--Please select the region--</option>
														<option value="Asia">Asia</option>
														<option value="Europe">Europe</option>
													</select>

												</div>
												<div rel="region" class="helper required "></div>
											</div>
										</div>

										<label for="country">Please select the country</label>
										<div class="row category-hybrid">
											<div class="column large-12 category-hybrid-root">
												<div>
													<select name="user.country" id="country">
														<option value="0">--Please select the country--</option>
													</select>
												</div>
												<div rel="region" class="helper required "></div>
											</div>
										</div>

										<label for="companyType">Please select the company
											type</label>
										<div class="row category-hybrid">
											<div class="column large-12 category-hybrid-root">
												<div>
													<select name="user.companyType" id="companyType"
														onChange="changeCompanyType()">
														<option value="0">--Please select the company
															type--</option>
														<option value="Offshore">Offshore</option>
														<option value="Engineering">Engineering</option>
														<option value="Commercial">Commercial</option>
														<option value="Agent">Agent</option>
														<option value="Broker">Broker</option>
														<option value="Shipyard">Shipyard</option>
														<option value="ShipRepairingYard">Ship Repairing
															Yard</option>
														<option value="FinancialInvestor">Financial
															Investor</option>
													</select>

												</div>
												<div rel="region" class="helper required "></div>
											</div>
										</div>

										<label for="companySubType">Please select the company
											sub-type</label>
										<div class="row category-hybrid">
											<div class="column large-12 category-hybrid-root">
												<div>
													<select name="user.companySubType" id="companySubType">
														<option value="0">--Please select the company
															sub-type--</option>
													</select>
												</div>
												<div rel="region" class="helper required "></div>
											</div>
										</div>

										<div rel="region" class="helper required "></div>
									</div>
								</div>
							</div>
						</div>

						<div class="row collapse">
							<button class="small right" id="email-next" type="submit"
								name="next" value="next">Next</button>
						</div>
					</s:form>

				</div>
			</div>

		</article>
	</div>
</section>

<script type="text/javascript">
	function changeRegion() {
		with (window.document.myForm) {
			var regions = new Array();

			regions["0"] = [ "--Please select the region--" ];
			regions["Asia"] = [ "China", "Japan", "Singapore" ];
			regions["Europe"] = [ "UK", "France", "German", "Swiss" ];
			var value = region.value;
			country.options.length = 0;
			var option;

			option = new Option("--Please select the country--", "0");
			country.options.add(option);
			for (i = 0; i < regions[value].length; i++) {
				option = new Option(regions[value][i], regions[value][i]);
				country.options.add(option);
			}
		}
	}

	function changeCompanyType() {
		with (document.myForm) {
			var companyTypes = new Array();
			companyTypes["0"] = [ "--Please select the company type--" ];
			companyTypes["Offshore"] = [ "Jack up drilling rig",
					"semi-sub rig", "accommodation barge", "AHTS" ];
			companyTypes["Engineering"] = [ "engineering" ];
			companyTypes["Commercial"] = [ "bulk carrier", "tanker",
					"container vessel" ];
			companyTypes["Agent"] = [ "agent" ];
			companyTypes["Broker"] = [ "broker" ];
			companyTypes["Shipyard"] = [ "shipyard" ];
			companyTypes["ShipRepairingYard"] = [ "ship repairing yard" ];
			companyTypes["FinancialInvestor"] = [ "financial investor" ];

			var value = companyType.value;
			companySubType.options.length = 0;
			var option;

			option = new Option("--Please select the company sub-type--", "0");
			companySubType.options.add(option);

			for (i = 0; i < companyTypes[value].length; i++) {
				option = new Option(companyTypes[value][i],
						companyTypes[value][i]);
				companySubType.options.add(option);
			}
			if (areas.value == "0")
				companySubType.disabled = true;
			else
				companySubType.disabled = false;
		}
	}

	
</script>